{include file="public/head" /}
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">后台管理</a>
        <a href="">发票管理中心</a>
        <a>
          <cite>发票列表</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:window.location.reload();" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so"  method="get" action="#">
          
          <div class="layui-input-inline">
            <select name="parkingNo" lay-filter="parkingNo" id="parkingNo">
              <option value="">所属停车场</option>
              {foreach $parkinglist as $parking}
              <option value="{$parking.parkingNo}" {if isset($parkingNo)}{if $parkingNo == $parking.parkingNo}selected {/if}{/if}>{$parking.parkingName}</option>
              {/foreach}
            </select>
          </div>
         
          
          <input type="text" name="car_number"  id="car_number" placeholder="车牌号" autocomplete="off" class="layui-input" value="{if isset($car_number)}{$car_number}{/if}">
          
          
          
          
         
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
      <xblock>
        
        <!--<button class="layui-btn layui-btn-danger" onclick="billExportExcel()"><i class="layui-icon"></i>批量导出</button>
        <button class="layui-btn layui-btn-danger" onclick="invoice()"><i class="layui-icon"></i>电子发票</button>-->
        <span class="x-right" style="line-height:40px">&nbsp;&nbsp;&nbsp;&nbsp; <!--共有数据：   条--></span>
      </xblock>
      <table class="layui-table"  id="table">
        <thead>
          <tr>
            
            <th style="text-align: center;font-size: 16px;height:20px ">ISV停车场ID</th>
            
            <th style="text-align: center; ">停车场名称</th>
            <th style="text-align: center; ">车牌号</th>
			<th style="text-align: center; ">手机号</th>
			<th style="text-align: center; ">邮箱</th>
            <th style="text-align: center;">订单金额</th>
            <th style="text-align: center; ">发票类型</th>
            <th style="text-align: center;">企业名称</th>
            <th style="text-align: center;">税号</th>
             <th style="text-align: center;">电话</th>
            <th style="text-align: center;">地址</th>
            <th style="text-align: center;">银行账号</th> 
            <th style="text-align: center;">开户行</th>
			<th style="text-align: center;">状态</th>
			<th style="text-align: center;">操作</th>
            </tr>
        </thead>
        <tbody>
          {foreach $list as $val}
          <tr>
            
           
            <td style="text-align: center;">{$val.parkingNo}</td>
            <td style="text-align: center;">{$val.parkingName}</td>
			
            <td style="text-align: center;">{$val.car_number}</td>
			<td style="text-align: center;">{$val.phone}</td>
			<td style="text-align: center;">{$val.mail}</td>
            <td style="text-align: center;">{$val.money}</td>
            <td style="text-align: center;font-size: 12px;">
				{if $val.invoice_type == '1'}
				个人
				{/if}
				{if $val.invoice_type == '2'}
				企业
				{/if}
			</td>
            <td style="text-align: center;font-size: 12px;">{$val.buyerName}</td>
            <td style="text-align: center;font-size: 12px;">{$val.buyerTaxNum}</td>
            <td style="text-align: center;">{$val.buyerTel}
			</td>
            <td style="text-align: center;">{$val.buyerAddress}</td>
              <td style="text-align: center;">{$val.account}</td>
            <td class="td-manage" style="text-align: center;">
              {$val.bank}
            </td>
			<td class="td-manage" style="text-align: center;">
				{if $val.invoice_state  == '1'}
				已开票
				{/if}
				{if $val.invoice_state == '2'}
				未开票
				{/if}
            </td>
			<td class="td-manage" style="text-align: center;">
			{if $val.invoice_state == '2'}
             
			  <span class="layui-btn layui-btn-normal " onclick="invoice('{$val.id}')">开票 </span>
			{/if}
            {if $val.invoice_state == '1'}
                <!--<button class="layui-btn" onclick="x_admin_show('查看发票','{:url(\'CheckEInvoice\')}?uid={{$val.id}}',900,700)">查看</button>-->
                <button class="layui-btn" onclick="CheckEInvoice('{$val.id}')">查看</button>
             {/if}
            </td>
          </tr>
          {/foreach}
        </tbody>
      </table>
      <div class="page">
        <div>
            {$list->render()|raw}
        </div>
      </div>

    </div>
    <script>
      layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
          ,format: 'yyyy-MM-dd HH:mm:ss'
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
          ,format: 'yyyy-MM-dd HH:mm:ss'
        });
      });
      function CheckEInvoice(id){
          var url = "{:url('CheckEInvoice')}?&uid=" + id;
          layer.open({
              type: 2,
              title: '查询发票',
              shadeClose: true,
              shade: 0.8,
              area: ['70%', '100%'],
              content: url //iframe的url
          });
      }
      //开票
      function invoice(id){
        if(confirm('是否开票?'))
        { 
          var url = "{:url('invoice')}?id=" + id
			window.location.href=url
        } 
          return false; 
      }

    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>
  </body>

</html>